Skip to content

fix(runner): guard microVM launcher Pdeathsig behind a linux build tag (RIG-3213) - #848

Merged
trunk-io[bot] merged 2 commits into
mainfrom
compass-runner/rig-3213-darwin-pdeathsig
Sep 4, 2026
Merged

fix(runner): guard microVM launcher Pdeathsig behind a linux build tag (RIG-3213)#848
trunk-io[bot] merged 2 commits into
mainfrom
compass-runner/rig-3213-darwin-pdeathsig

Conversation

@rigel-mintaka

Copy link
Copy Markdown
Contributor

launch.go is tagged //go:build unix (which includes darwin) yet named
syscall.SysProcAttr{Pdeathsig: syscall.SIGTERM} directly. Pdeathsig
(PR_SET_PDEATHSIG) is a Linux-only field, so any darwin compile of the
microvm package failed:

launch.go:298:43: unknown field Pdeathsig in struct literal of type
syscall.SysProcAttr

Latent until now — main's darwin gate does not compile microvm — but
restructured build tags pull microvm into the darwin compile of
./cmd/compass-app, exposing it, and it traps any future PR that
compiles microvm on darwin.

Extract the SysProcAttr construction into a platform helper:

  • orphanguard_linux.go (//go:build linux) sets Pdeathsig (behavior
    byte-identical to today).
  • orphanguard_other.go (//go:build unix && !linux) returns nil — no
    PR_SET_PDEATHSIG equivalent on darwin. The launcher only runs for real
    on Linux/KVM and teardown correctness rests on Shutdown, not the guard
    (record §(g)), so the darwin no-op loses nothing that matters.

launch.go calls the helper instead of naming the Linux-only field, so
the unix-tagged package cross-compiles on darwin.

Verified: GOOS=darwin GOARCH=arm64 go build ./internal/runtime/microvm/
was red, now green; linux build (plain + -tags microvm) green; untagged
microvm unit tests pass; full lint 0 issues; nilaway clean.

Refs RIG-3213, RIG-2591
Co-authored-by: Matt Wilkinson matt@rigel.build

…g (RIG-3213)

`launch.go` is tagged `//go:build unix` (which includes darwin) yet named
`syscall.SysProcAttr{Pdeathsig: syscall.SIGTERM}` directly. `Pdeathsig`
(PR_SET_PDEATHSIG) is a Linux-only field, so any darwin compile of the
microvm package failed:

    launch.go:298:43: unknown field Pdeathsig in struct literal of type
    syscall.SysProcAttr

Latent until now — main's darwin gate does not compile microvm — but
restructured build tags pull microvm into the darwin compile of
`./cmd/compass-app`, exposing it, and it traps any future PR that
compiles microvm on darwin.

Extract the SysProcAttr construction into a platform helper:

- `orphanguard_linux.go` (`//go:build linux`) sets Pdeathsig (behavior
  byte-identical to today).
- `orphanguard_other.go` (`//go:build unix && !linux`) returns nil — no
  PR_SET_PDEATHSIG equivalent on darwin. The launcher only runs for real
  on Linux/KVM and teardown correctness rests on Shutdown, not the guard
  (record §(g)), so the darwin no-op loses nothing that matters.

`launch.go` calls the helper instead of naming the Linux-only field, so
the unix-tagged package cross-compiles on darwin.

Verified: `GOOS=darwin GOARCH=arm64 go build ./internal/runtime/microvm/`
was red, now green; linux build (plain + `-tags microvm`) green; untagged
microvm unit tests pass; full lint 0 issues; nilaway clean.

Refs RIG-3213, RIG-2591
Co-authored-by: Matt Wilkinson <matt@rigel.build>
@linear-code

linear-code Bot commented Sep 3, 2026

Copy link
Copy Markdown

RIG-3213

RIG-2591

@trunk-io

trunk-io Bot commented Sep 3, 2026

Copy link
Copy Markdown

😎 Merged successfully - details.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-runner-rig-3213-darw.compass-eng-docs.pages.dev

Deployed from compass-runner/rig-3213-darwin-pdeathsig at 8a2d5cb.

…213)

Rename the two orphan-guard platform files so their build constraint lives
solely in the explicit //go:build tag, not split across a tag and a GOOS
filename suffix:

- orphanguard_linux.go   -> orphanguard_pdeathsig.go  (//go:build linux)
- orphanguard_other.go   -> orphanguard_noop.go       (//go:build unix && !linux)

`_linux.go` carried an implicit `//go:build linux` constraint from its GOOS
suffix on top of the explicit tag; the companion `_other.go` relied on the
explicit tag alone (no single GOOS suffix expresses "all non-linux unix").
Using one mechanism for both — explicit tags, descriptive names — is the
consistency the split was meant to express. Content is unchanged; the
partition is identical (linux+android -> pdeathsig helper; other unix ->
noop helper).

Refs RIG-3213
Co-authored-by: Matt Wilkinson <matt@rigel.build>
@mattwilkinsonn

Copy link
Copy Markdown
Contributor

/trunk merge

@trunk-io
trunk-io Bot merged commit 17111cc into main Sep 4, 2026
15 checks passed
@trunk-io
trunk-io Bot deleted the compass-runner/rig-3213-darwin-pdeathsig branch September 4, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants